{% extends 'cms/cms_base.html' %}

{% block title %}
    板块管理
{% endblock %}

{% block head %}
    <script src="{{ static('cms/js/boards.js') }}"></script>
{% endblock %}

{% block page_title %}
    {{ self.title() }}
{% endblock %}

{% block main_content %}
    <div class="top-box">
        <button class="btn btn-warning" style="float: right" id="add-board-btn">
            添加新模块
        </button>

    </div>
    <table class="table table-bordered">
        <thead>
        <tr>
            <th>
                板块名称
            </th>
            <th>
                帖子数量
            </th>
            <th>
                创建时间
            </th>
            <th>
                操作
            </th>
        </tr>
        </thead>
        <tbody>
        {% for board in boards %}
            <tr data-name="{{ board.name }}" data-id="{{ board.id }}">
                <td>{{ board.name }}</td>
                <td>0</td>
                <td>{{ board.create_time|time_format }}</td>
                <td>
                    <button class="btn btn-default edit-board-btn btn-xs">编辑</button>
                    <button class="btn btn-danger delete-board-btn btn-xs">删除</button>
                </td>
            </tr>
        {% endfor %}


        </tbody>
    </table>
{% endblock %}